package de.wiroo.setup.web.comp;

import javax.validation.constraints.NotNull;

import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.validation.validator.StringValidator;

import de.stefanocke.roo.wicket.RooEmbed;
import de.stefanocke.roo.wicket.RooFormFields;
import de.stefanocke.roo.wicket.RooProperties;
import de.stefanocke.roo.wicket.RooProperty;
import de.stefanocke.roo.wicket.RoundTripMode;
import de.wiroo.setup.domain.Whole;

@RooFormFields(modelClass = Whole.class)
@RooProperties(modelClass = Whole.class, roundTrip = RoundTripMode.OFF)
public class WholeFormFields {

    private static final long serialVersionUID = 1L;

    @RooProperty
    @NotNull
    public static final String NAME = "name";
//
//    @RooProperty
//    @RooSelect
//    public static final String ONEPART = "onePart";

    @RooProperty
    @RooEmbed
    public static final String MANYPARTS = "manyParts";

//    @RooProperty
//    public static final String SOMEDOUBLE = "someDouble";
//
//    @RooProperty
//    public static final String SOMEINT = "someInt";
//
    @RooProperty
    @NotNull
    public static final String SOMEDATE = "someDate";
//
//    @RooProperty
//    public static final String NUMBER = "number";
//
//    @RooProperty
//    public static final String MANYPARTSSELECT = "manyPartsSelect";
//
//    @RooProperty
//    public static final String SOMECALENDAR = "someCalendar";
//
//    @RooProperty
//    public static final String TAGS = "tags";
//
//    @RooProperty
//    public static final String DEMO = "demo";
//
//    @RooProperty
//    public static final String SOMEBOOLEANOBJECT = "someBooleanObject";
//
//    @RooProperty
//    public static final String EMBEDDEDPART = "embeddedPart";
//
//    @RooProperty
//    public static final String VOTE = "vote";
//
//    @RooProperty
//    public static final String SOMEBOOLEAN = "someBoolean";
//
//    @RooProperty
//    public static final String MANYVOTES = "manyVotes";
//
//    @RooProperty
//    public static final String NUMBERS = "numbers";
    
    protected void onInitForm(Form<?> form) {
    	getFormComponent(NAME).add(new StringValidator(4,4));
    };
}
